Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(sdk): switch function log format from text to JSON for AWS platforms #5955

Merged
merged 7 commits into from
Jul 4, 2024

Conversation

garysassano
Copy link
Collaborator

@garysassano garysassano commented Mar 16, 2024

A best practice when authoring Lambda functions is to use the Powertools for AWS Lambda Logger, which allows to emit structured logs in JSON format. However, even if you choose not to use Powertools, you can still take advantage of the JSON format to make navigating through your functions' logs much easier. This is true especially for the system logs, over which you have no direct control.

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@garysassano garysassano requested a review from a team as a code owner March 16, 2024 09:41
Copy link

github-actions bot commented Mar 16, 2024

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistence, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @eladb
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @hasanaburayyan
Wing Playground @eladcon

@monadabot
Copy link
Contributor

monadabot commented Mar 16, 2024

Console preview environment is available at https://wing-console-pr-5955.fly.dev 🚀

Last Updated (UTC) 2024-07-04 00:45

@monadabot
Copy link
Contributor

monadabot commented Mar 16, 2024

Benchmarks

Comparison to Baseline ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
Benchmark Before After Change
version ... ... ...
jsii_small.test.w -t sim 394ms±24.88 381ms±6.98 -13ms (-3.26%)⬜
jsii_small.test.w -t tf-aws 617ms±5.84 611ms±7.02 -6ms (-0.98%)⬜
jsii_big.test.w -t sim 2990ms±34.21 2965ms±13.33 -26ms (-0.86%)⬜
jsii_big.test.w -t tf-aws 3184ms±7.83 3183ms±14.51 -1ms (-0.02%)⬜
functions_10.test.w -t sim 501ms±10.17 492ms±18.28 -8ms (-1.68%)⬜
functions_10.test.w -t tf-aws 2114ms±9.84 2099ms±12.94 -15ms (-0.71%)⬜
hello_world.test.w -t sim 409ms±6.48 402ms±4.31 -6ms (-1.58%)⬜
hello_world.test.w -t tf-aws 1467ms±12.05 1465ms±6.96 -2ms (-0.16%)⬜
empty.test.w -t sim 367ms±2.95 365ms±5.98 -1ms (-0.34%)⬜
empty.test.w -t tf-aws 605ms±2.92 599ms±3.91 -6ms (-1%)⬜
functions_1.test.w -t sim 406ms±4.78 405ms±4.27 -1ms (-0.36%)⬜
functions_1.test.w -t tf-aws 843ms±7.11 830ms±7.04 -13ms (-1.6%)⬜

⬜ Within 1.5 standard deviations
🟩 Faster, Above 1.5 standard deviations
🟥 Slower, Above 1.5 standard deviations

Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI.

Results
name mean min max moe sd
version ... ... ... ... ...
jsii_small.test.w -t sim 381ms 369ms 402ms 7ms 10ms
jsii_small.test.w -t tf-aws 611ms 594ms 628ms 7ms 10ms
jsii_big.test.w -t sim 2965ms 2939ms 3001ms 13ms 19ms
jsii_big.test.w -t tf-aws 3183ms 3158ms 3225ms 15ms 20ms
functions_10.test.w -t sim 492ms 425ms 515ms 18ms 26ms
functions_10.test.w -t tf-aws 2099ms 2079ms 2139ms 13ms 18ms
hello_world.test.w -t sim 402ms 392ms 413ms 4ms 6ms
hello_world.test.w -t tf-aws 1465ms 1451ms 1484ms 7ms 10ms
empty.test.w -t sim 365ms 352ms 383ms 6ms 8ms
empty.test.w -t tf-aws 599ms 592ms 609ms 4ms 5ms
functions_1.test.w -t sim 405ms 398ms 415ms 4ms 6ms
functions_1.test.w -t tf-aws 830ms 817ms 841ms 7ms 10ms
Last Updated (UTC) 2024-07-04 00:51

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Mar 16, 2024
@tsuf239
Copy link
Contributor

tsuf239 commented Mar 18, 2024

@Chriscbr what do you think?

@Chriscbr
Copy link
Contributor

It sounds handy, let's try it 👍

@tsuf239 tsuf239 removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Mar 24, 2024
@tsuf239
Copy link
Contributor

tsuf239 commented Mar 24, 2024

Hi @garysassano,
Can you please resolve the conflicts?
(you can accept incoming changes, and let the PR actions fix them)

@tsuf239
Copy link
Contributor

tsuf239 commented Mar 24, 2024

I started an automated test on aws here

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Mar 24, 2024
@tsuf239 tsuf239 added the 🚧 pr/do-not-merge PRs with this label will not be automatically merged by mergify. label Mar 24, 2024
@tsuf239
Copy link
Contributor

tsuf239 commented Mar 24, 2024

The automated aws tests are failing: #5955 (comment)
I'm not sure, but it seems like this PR caused it indirectly- and that a fix is needed at our end
@MarkMcCulloh what do you think?

Copy link

github-actions bot commented Apr 14, 2024

Hi,

This PR has not seen activity in 20 days. Therefore, we are marking the PR as stale for now. It will be closed after 7 days.
If you need help with the PR, do not hesitate to reach out in the winglang community discord at winglang.discord.com.
Feel free to re-open this PR when it is still relevant and ready to be worked on again.
Thanks!

@tsuf239
Copy link
Contributor

tsuf239 commented Apr 17, 2024

Hi @garysassano, can you please update from main?

@monadabot
Copy link
Contributor

❌ Unstable Self-Mutation ❌

Self-mutation has run twice in a row. There may be a something non-deterministic in the build or test process.
Check the last mutation commit (ec85f99) for suspicious changes.
This is typically caused by:

  • Absolute paths
  • Timestamps
  • Random values
  • Flakey tests (relying on one of the above)

@tsuf239
Copy link
Contributor

tsuf239 commented Apr 28, 2024

@garysassano math doesn't seem to work on AWS, can you please check? https://github.com/winglang/wing/actions/runs/8866141232/job/24343706916
(also, it doesn't pass mutation)

@garysassano
Copy link
Collaborator Author

I opened issue #6363, it should be fine once it gets fixed.

@tsuf239
Copy link
Contributor

tsuf239 commented May 15, 2024

Sdk spec tests are successful on tf-aws!
🤩

it can be merged as soon as you'll fix the pr action

@tsuf239 tsuf239 removed 🚧 pr/do-not-merge PRs with this label will not be automatically merged by mergify. ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! labels May 15, 2024
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label May 21, 2024
@staycoolcall911 staycoolcall911 removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Jun 5, 2024
Copy link

Hi,

This PR has not seen activity in 20 days. Therefore, we are marking the PR as stale for now. It will be closed after 7 days.
If you need help with the PR, do not hesitate to reach out in the winglang community Discord.
Feel free to re-open this PR when it is still relevant and ready to be worked on again.
Thanks!

@github-actions github-actions bot added the Stale label Jun 26, 2024
@github-actions github-actions bot closed this Jul 3, 2024
@tsuf239
Copy link
Contributor

tsuf239 commented Jul 3, 2024

Hi @garysassano do you need any help?

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Jul 4, 2024
@github-actions github-actions bot removed the Stale label Jul 4, 2024
@tsuf239 tsuf239 removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Jul 4, 2024
@tsuf239
Copy link
Contributor

tsuf239 commented Jul 4, 2024

Copy link
Contributor

mergify bot commented Jul 4, 2024

Thanks for contributing, @garysassano! This PR will now be added to the merge queue, or immediately merged if gary/aws-logs-json is up-to-date with main and the queue is empty.

mergify bot added a commit that referenced this pull request Jul 4, 2024
@mergify mergify bot merged commit 3ad156b into main Jul 4, 2024
15 checks passed
@mergify mergify bot deleted the gary/aws-logs-json branch July 4, 2024 09:01
@tsuf239
Copy link
Contributor

tsuf239 commented Jul 4, 2024

Well done @garysassano!!! 🏆 🎉🥳🎉👏👏👏

@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.76.11.

@revitalbarletz
Copy link
Contributor

Well done @garysassano !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants